package structuralpattern.adapterpattern;
/**
 * 邢帅教育
 * <p>
 * 本源代码由数据中心及其作者共同所有，未经版权持有者的事先书面授权，
 * 不得使用、复制、修改、合并、发布、分发和/或销售本源代码的副本。
 *
 * @copyright Copyright (c) 2018. xsteach.com all rights reserved.
 */

import structuralpattern.adapterpattern.cup.CoffeeCup;
import structuralpattern.adapterpattern.cup.Cup;
import structuralpattern.adapterpattern.cup.TeaCup;

/**
 * @author maikec
 * @date 2018/9/5
 */
public class Customer {
    public static void main(String[] args) {
        getTeaCupColor();
        System.out.println();
        getCoffeeCupColor();
    }

    private static void getCoffeeCupColor() {
        //适配茶杯
        Cup cup = new CoffeeCup();
        Container container = new Salesmen( cup );
        System.out.println( container.getColor() );
    }

    private static void getTeaCupColor() {
        //适配茶杯
        Cup cup = new TeaCup();
        Container container = new Salesmen( cup );
        System.out.println( container.getColor() );
    }
}
